<template>
    <div class="tuan">
        <div class="banner">
            <h1>爆爆团</h1>
            <h2>限时爆款 超级低价</h2>
        </div>
        <!-- 商品 -->
        <div class="ing">
            <span :class="{active:currentIndex==index}" v-for="(item,index) in arr" :key="index" @click="currentIndex=index">{{item}}</span>
        </div>
        <component :is="coms[currentIndex]"></component>
    </div>
</template>

<script>
import qianggou from "../../components/qianggou.vue";
import shangxin from "../../components/shangxin.vue";
export default {
    data(){
        return{
            currentIndex:0,
            arr:['正在抢购','上新预告'],
            coms:[qianggou,shangxin],
        }
    },
}
</script>

<style lang="scss" scoped>
.tuan{
    background: #f5f5f5;
}
.banner{
    background: linear-gradient(red,orangered);
    opacity: 0.8;
    overflow: hidden;
    text-align: center;
}
h1{
    color: white;
    margin: 24px;
    font-size: 20px;
    margin-bottom: 30px;
}
h2{
    color: yellow;
    font-size: 30px;
    margin-bottom: 20px;
}
// 商品
.ing{
    background: linear-gradient(orangered,rgb(238, 193, 28));
    height: 50px;
    line-height: 50px;
}
.ing span{
    margin:0 20px;
    color: white;
}
.ing .active{
    border-bottom: 2px solid white;
}
</style>